/******************************************************************************
	This file is a part of the Snapshot Bioinformatics Project

	Copyright (C) 2012-2013 Jarom Schow

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef WORKBENCH_UI_H
#define WORKBENCH_UI_H

#include <QtWidgets/QMainWindow>

#include "SqlServer.h"

class WorkbenchWgt;
class Bio::SqlServer;
class Connection;
class QLabel;

class WorkbenchUI : public QMainWindow {
	Q_OBJECT
	friend class Workbench;
public:
	WorkbenchUI();
	virtual ~WorkbenchUI();

	virtual bool	event( QEvent *e );

protected:

	virtual void	closeEvent( QCloseEvent *e );

private slots:

	void	connectToDB();
	void	createDB();
	void	loadSeqFiles();
	void	loadGenBank();
	void	viewLogFile();
	void	testProgress();
	void	updateTaxonomy();

private:

	void	init();
	void	buildMainMenu();
	void	restoreUI();
	void	saveUI();
	bool	connectToDB( const Bio::SqlServerSettings &settings );
	bool	createDB( const Bio::SqlServerSettings &settings );
	bool	loadSeqFile( const QString &filename );

	WorkbenchWgt	*m_benchWgt;
	Bio::SqlServer	*m_server;
	QLabel			*m_dbStatusLbl;
};

#endif // WORKBENCH_UI_H